﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;




namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            TUNIT UNITA = new TUNIT();
            UNITA.UNITCODE = "0001";
            UNITA.UNITMAST = "kazarus.0001";
            UNITA.UNITMEMO = "company";
            UNITA.UNITNAME = "com.kazarus.0001";

            TUNIT UNITB = new TUNIT();
            UNITB.UNITCODE = "0002";
            UNITB.UNITMAST = "kazarus.0002";
            UNITB.UNITMEMO = "company";
            UNITB.UNITNAME = "com.kazarus.0002";

            List<TUNIT> list = new List<TUNIT>();
            list.Add(UNITA);

            Hashtable tabl = new Hashtable();
            tabl.Add(UNITA.UNITCODE,UNITA);
            tabl.Add(UNITB.UNITCODE,UNITB);

            System.Console.WriteLine(list.Count);
            System.Console.WriteLine(tabl.Count);
            System.Console.WriteLine(UNITA.GetObjtIdentity());

            if (tabl.ContainsKey("0002"))
            {
                TUNIT UNITX = (TUNIT)tabl["0002"];
                System.Console.WriteLine(UNITX.UNITNAME);

            }

        }
    }
}
